/*
 * @Author: 刘润泽
 * @Date: 2023-03-14 17:52:41
 * @LastEditors: 刘润泽
 * @LastEditTime: 2023-03-14 19:40:28
 * @Description: 
 */
package server.business.converter.Converter;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.property.ExcelContentProperty;

public class StateConverter implements Converter<String> {
    @Override
    public Class<String> supportJavaTypeKey() {
        return String.class;
    }

    @Override
    public CellDataTypeEnum supportExcelTypeKey() {
        return CellDataTypeEnum.STRING;
    }

    @Override
    public CellData<String> convertToExcelData(String value, ExcelContentProperty excelContentProperty,
            GlobalConfiguration globalConfiguration) throws Exception {
        if (value == null) {
            return new CellData<>("");
        } else if (value.equals("1")) {
            return new CellData<>("入库");
        } else if (value.equals("2")) {
            return new CellData<>("在库");
        } else if (value.equals("3")) {
            return new CellData<>("已出库");
        } else if (value.equals("4")) {
            return new CellData<>("废弃申请");
        } else if (value.equals("5")) {
            return new CellData<>("患者退血中");
        } else if (value.equals("6")) {
            return new CellData<>("血库退血中");
        } else if (value.equals("7")) {
            return new CellData<>("取消入库");
        } else if (value.equals("9")) {
            return new CellData<>("血站退血中");
        } else if (value.equals("10")) {
            return new CellData<>("配血");
        } else if (value.equals("11")) {
            return new CellData<>("待抽取血");
        } else if (value.equals("12")) {
            return new CellData<>("已抽取血");
        } else if (value.equals("13")) {
            return new CellData<>("血液加工");
        } else if (value.equals("14")) {
            return new CellData<>("废弃");
        } else if (value.equals("15")) {
            return new CellData<>("血袋回收");
        } else if (value.equals("16")) {
            return new CellData<>("血袋销毁");
        } else if (value.equals("17")) {
            return new CellData<>("待退血");
        } else if (value.equals("18")) {
            return new CellData<>("退血审核完成");
        } else if (value.equals("19")) {
            return new CellData<>("退血退钱完成");
        } else if (value.equals("20")) {
            return new CellData<>("退血申请驳回");
        } else if (value.equals("21")) {
            return new CellData<>("申请");
        } else if (value.equals("22")) {
            return new CellData<>("患者退血申请");
        } else if (value.equals("23")) {
            return new CellData<>("血站退血申请");
        } else if (value.equals("24")) {
            return new CellData<>("血液退回血战审批通过");
        } else if (value.equals("25")) {
            return new CellData<>("血液退回血站审批驳回");
        } else if (value.equals("26")) {
            return new CellData<>("已过期");
        } else if (value.equals("27")) {
            return new CellData<>("已取血");
        }else if (value.equals("28")) {
            return new CellData<>("待取血");
        }
        else {
            return new CellData<>("错误数据");
        }
    }

    @Override
    public String convertToJavaData(CellData arg0, ExcelContentProperty arg1, GlobalConfiguration arg2)
            throws Exception {
        throw new UnsupportedOperationException("Unimplemented method 'convertToJavaData'");
    }
}
